package bird.stack.array_stack;

import bird.stack.array_stack.ArrayStack;

/**
 * @author sijunqiang
 * @data 2021/5/22 17:35
 * @description: 测试自己定义的栈
 */
public class Main {

    public static void main(String[] args) {
        ArrayStack<Integer> arrayStack = new ArrayStack<>();
        // Test push element to stack
        for (int i = 0; i < 5; i++) {
            arrayStack.push(i);
            System.out.println(arrayStack);
        }

        // Test pop element to stack
         arrayStack.pop();
        System.out.println(arrayStack);

        //Test peek element to stack
        Integer peek = arrayStack.peek();
        System.out.println("top = " + peek);

    }
}
